package com.atguigu.gulimall.product.service;

import com.atguigu.gulimall.product.entity.SpuInfoDescEntity;
import com.atguigu.gulimall.product.vo.SpuSaveVo;
import com.baomidou.mybatisplus.extension.service.IService;
import com.atguigu.common.utils.PageUtils;
import com.atguigu.gulimall.product.entity.SpuInfoEntity;

import java.util.Map;

/**
 * spu信息
 *
 * @author syh
 * @email syh794996@163.com
 * @date 2022-06-06 20:58:42
 */
public interface SpuInfoService extends IService<SpuInfoEntity> {

    PageUtils queryPage(Map<String, Object> params);

    void saveSpuInfo(SpuSaveVo spuSaveVo);

    /**
     * 保存spu基本信息数据
     *
     * @param infoEntity
     */
    void saveBaseSpuInfo(SpuInfoEntity infoEntity);

    /**
     * spu页面数据+检索功能
     *
     * @param params
     * @return
     */
    PageUtils queryPageByCondition(Map<String, Object> params);

    /**
     * 商品上架功能
     *
     * @param spuId 根据商品id将数据保存到es中
     * @return
     */
    void up(Long spuId);

    /**
     * 根据商品id获取对应的spu信息
     *
     * @param skuId
     * @return
     */
    SpuInfoEntity getSpuInfoBySkuId(Long skuId);
}

